package test.db.table.mysql.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwUserTraceTable implements Table, ColumnType {
    SID(Column.sid),
    USER_SID(Column.userSid),
    ACTION_TYPE(Column.actionType),
    ACTION_TARGET(Column.actionTarget),
    ACTION_ID(Column.actionId),
    USER_IP(Column.userIp),
    REGIST_DATE(Column.registDate),
    REGIST_TIME(Column.registTime),
    REGIST_TIMESTAMP(Column.registTimestamp);
    
    private final Column column;
    private static final String TYPE_ACTION_TYPE = "VARCHAR(12)";
    private static final String TYPE_ACTION_TARGET = "VARCHAR(32)";
    private static final String TYPE_ACTION_ID = "VARCHAR(12)";

    PwUserTraceTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        userSid {
            String getType() {
                return TYPE_USER_SID;
            }
        },

        actionType {
        	String getType() {
        		return TYPE_ACTION_TYPE;
        	}
        },
        
        actionTarget {
        	String getType() {
        		return TYPE_ACTION_TARGET;
        	}
        },
        
        actionId {
        	String getType() {
        		return TYPE_ACTION_ID;
        	}
        },
        
        userIp {
        	String getType() {
        		return TYPE_USER_IP;
        	}
        },

        registDate {
            String getType() {
                return TYPE_REGIST_DATE;
            }
        },
        
        registTime {
        	String getType() {
        		return TYPE_REGIST_TIME;
        	}
        },
        
        registTimestamp {
            String getType() {
                return TYPE_REGIST_TIMESTAMP;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
    }
}